<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 100px;
        }
        #box1{
            border-bottom: solid 1px #000;
        }

        #box2{
            position: relative;
        }
        #box2::after{
            content: '';
            display: block;
            width: 100%;
            height: 1px;
            background: black;
            position: absolute;
            bottom: 0;
            left: 0;
        }
        @media screen and (-webkit-min-device-pixel-ratio: 2) {
            #box2::after{
                /* transform: scaleY(0.5); */
                height: 0.5px;
            }
        }

        @media screen and (-webkit-min-device-pixel-ratio: 3) {
            #box2::after{
                /* transform: scaleY(0.3333); */
                height: 0.333px;
            }
        }
    </style>
</head>
<body>
    <div id="box1"></div>

    <div id="box2"></div>
</body>
</html>